﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmoLiteApi
{
    /// <summary/>
    internal static class Constant
    {
        // attribute constants
        internal const string ATTRIBUTE_DATA_TYPE = "DataType";
        internal const string ATTRIBUTE_FIRST_INCLUDE = "FirstInclude";
        internal const string ATTRIBUTE_FIRST_NOT_INCLUDE = "FirstNotInclude";
        internal const string ATTRIBUTE_LAST = "Last";
        internal const string ATTRIBUTE_PASSWORD = "Password";
        internal const string ATTRIBUTE_HAS_INCLUDES = "HasIncludes";
        internal const string ATTRIBUTE_INDEXED_COLUMNS = "IndexedColumns";
        internal const string ATTRIBUTE_IS_INCLUDED = "IsIncluded";
        
        // char constants
        internal const char CHAR_BRACKET_LEFT = '{';
        internal const char CHAR_BRACKET_RIGHT = '}';

        // parameter constants
        internal const string PARAMETER_LOGINAME = "loginame";
        internal const string PARAMETER_MEMBER_NAME = "membername";
        internal const string PARAMETER_NAME = "name";
        internal const string PARAMETER_RECOVERY_MODEL = "recovery_model";
        internal const string PARAMETER_REQUEST_SESSION_ID = "request_session_id";
        internal const string PARAMETER_ROLE_NAME = "rolename";
        internal const string PARAMETER_VALUE = "value";
        internal const string PARAMETER_SCHEMA = "schema";
        internal const string PARAMETER_TABLE = "table";
        internal const string PARAMETER_VIEW = "view";
        internal const string PARAMETER_IS_NULLABLE = "is_nullable";
        internal const string PARAMETER_IS_IDENTITY = "is_identity";
        internal const string PARAMETER_PRECISION = "precision";
        internal const string PARAMETER_SCALE = "scale";
        internal const string PARAMETER_IS_MAX = "ismax";
        internal const string PARAMETER_MAX_LENGTH = "max_length";
        internal const string PARAMETER_SQL_DB_TYPE = "sqldatatype";
        internal const string PARAMETER_REFERENCED_TABLE = "referencedtable";
        internal const string PARAMETER_REFERENCED_SCHEMA = "referencedschema";
        internal const string PARAMETER_REFERENCED_COLUMN = "referencedcolumn";
        internal const string PARAMETER_COLUMN = "column";
        internal const string PARAMETER_IS_UNIQUE = "is_unique";
        internal const string PARAMETER_IS_CLUSTERED = "is_clustered";
        internal const string PARAMETER_IS_PADDED = "is_padded";
        internal const string PARAMETER_FILL_FACTOR = "fill_factor";
        internal const string PARAMETER_IS_INCLUDED_COLUMN = "is_included_column";
        internal const string PARAMETER_IS_DESCENDING_KEY = "is_descending_key";
        internal const string PARAMETER_IS_PRIMARY_KEY = "is_primary_key";
        internal const string PARAMETER_TEXT = "text";
        internal const string PARAMETER_PROCEDURE = "procedure";
        internal const string PARAMETER_KEY_ORDINAL = "key_ordinal";
        internal const string PARAMETER_CATALOG = "catalog";
        internal const string PARAMETER_INDEX = "index";
        internal const string PARAMETER_LEVEL_ZERO_TYPE = "Level0Type";
        internal const string PARAMETER_LEVEL_ZERO_NAME = "Level0Name";

        // procedure constants
        internal const string PROCEDURE_CHANGE_DB_OWNER = "sys.sp_changedbowner";
        internal const string PROCEDURE_ADD_EXTENDED_PROPERTY = "sys.sp_addextendedproperty";
        internal const string PROCEDURE_USER_ROLE_TO_MEMBER = "sys.sp_addrolemember";

        // property constants
        internal const string PROPERTY_SQL_DB_TYPE = "SqlDbType";

        internal const byte RECOVERY_MODEL_FULL = 1;
        internal const byte RECOVERY_MODEL_BULK_LOGGED = 2;
        internal const byte RECOVERY_MODEL_SIMPLE = 3;

        // template type name constants
        internal const string TEMPLATE_TYPE_NAME_DATABASE_CREATE = "DatabaseCreate";
        internal const string TEMPLATE_TYPE_NAME_DATABASE_ALTER_RECOVERY = "DatabaseAlterRecovery";
        internal const string TEMPLATE_TYPE_NAME_DATABASE_DROP = "DatabaseDrop";
        internal const string TEMPLATE_TYPE_NAME_DATABASE_SELECT = "DatabaseSelect";
        internal const string TEMPLATE_TYPE_NAME_DATABASE_ROLE_SELECT = "DatabaseRoleSelect";
        internal const string TEMPLATE_TYPE_NAME_DATABASE_EXTENDED_PROPERTY_SELECT = "DatabaseExtendedPropertySelect";
        internal const string TEMPLATE_TYPE_NAME_SCHEMA_EXTENDED_PROPERTY_SELECT = "SchemaExtendedPropertySelect";
        internal const string TEMPLATE_TYPE_NAME_COMMON_INDEX_CREATE = "CommonIndexCreate";
        internal const string TEMPLATE_TYPE_NAME_FOREIGN_KEY_CREATE = "ForeignKeyCreate";
        internal const string TEMPLATE_TYPE_NAME_LOGIN_CHANGE_PASSWORD = "LoginChangePassword";
        internal const string TEMPLATE_TYPE_NAME_LOGIN_CREATE = "LoginCreate";
        internal const string TEMPLATE_TYPE_NAME_LOGIN_DROP = "LoginDrop";
        internal const string TEMPLATE_TYPE_NAME_LOGIN_SELECT = "LoginSelect";
        internal const string TEMPLATE_TYPE_NAME_OBJECT_GRANT = "ObjectGrant";
        internal const string TEMPLATE_TYPE_NAME_OBJECT_PRINCIPAL_SELECT = "ObjectPrincipalSelect";
        internal const string TEMPLATE_TYPE_NAME_PROCESS_KILL = "ProcessKill";
        internal const string TEMPLATE_TYPE_NAME_PROCESS_SELECT = "ProcessSelect";
        internal const string TEMPLATE_TYPE_NAME_ROLE_CREATE = "RoleCreate";
        internal const string TEMPLATE_TYPE_NAME_SCHEMA_CREATE = "SchemaCreate";
        internal const string TEMPLATE_TYPE_NAME_SCHEMA_SELECT = "SchemaSelect";
        internal const string TEMPLATE_TYPE_NAME_STORED_PROCEDURE_DROP = "StoredProcedureDrop";
        internal const string TEMPLATE_TYPE_NAME_STORED_PROCEDURE_SELECT = "StoredProcedureSelect";
        internal const string TEMPLATE_TYPE_NAME_TABLE_CREATE = "TableCreate";
        internal const string TEMPLATE_TYPE_NAME_TABLE_COLUMN_SELECT = "TableColumnSelect";
        internal const string TEMPLATE_TYPE_NAME_TABLE_INDEX_SELECT = "TableIndexSelect";
        internal const string TEMPLATE_TYPE_NAME_VIEW_INDEX_SELECT = "ViewIndexSelect";
        internal const string TEMPLATE_TYPE_NAME_TABLE_FOREIGN_KEY_SELECT = "TableForeignKeySelect";
        internal const string TEMPLATE_TYPE_NAME_TABLE_SELECT = "TableSelect";
        internal const string TEMPLATE_TYPE_NAME_USER_CREATE = "UserCreate";
        internal const string TEMPLATE_TYPE_NAME_USER_DROP = "UserDrop";
        internal const string TEMPLATE_TYPE_NAME_USER_SELECT = "UserSelect";
        internal const string TEMPLATE_TYPE_NAME_VIEW_DROP = "ViewDrop";
        internal const string TEMPLATE_TYPE_NAME_VIEW_SELECT = "ViewSelect";
        internal const string TEMPLATE_TYPE_NAME_FULL_TEXT_CATALOG_SELECT = "FullTextCatalogSelect";
        internal const string TEMPLATE_TYPE_NAME_FULL_TEXT_CATALOG_CREATE = "FullTextCatalogCreate";
        internal const string TEMPLATE_TYPE_NAME_VIEW_FULL_TEXT_INDEX_CREATE = "ViewFullTextIndexCreate";
        internal const string TEMPLATE_TYPE_NAME_VIEW_FULL_TEXT_INDEX_SELECT = "ViewFullTextIndexSelect";
        internal const string TEMPLATE_TYPE_NAME_COMMON_INDEX_REBUILD = "CommonIndexRebuild";
        
        // constants
        internal const string FORMAT_SMO_EXCEPTION = "Sql: {0}";
        internal const string ENCODE_AFTER = "''";
        internal const string ENCODE_BEFORE = "'";
        internal const string STRING_SEPARATOR_START = "<INCLUDE>";
        internal const string STRING_SEPARATOR_END = "</INCLUDE>";
        internal const string STRING_LINE_FEED_CARRIAGE_RETURN = "\r\n";
        internal const string TEMPLATE_NAME_SPACE = "SmoLiteApi.Sql.Template";
        internal const string REGEX_GO = "^GO";
        internal const string EXCEPTION_NOT_LOADED = "The method or property cannot be used unless the object is loaded";
        internal const string DATABASE_MASTER = "master";
        internal const int FIVE_MINUTES = 300;
        internal const string EXTENDED_PROPERTY_SCHEMA = "Schema";
    }
}
